package com.surveyingandmapping.ionospheretec.service.impl;

import org.springframework.expression.ParseException;
import org.springframework.util.Assert;
import org.springframework.web.multipart.MaxUploadSizeExceededException;

import java.io.IOException;

/**
 * Created by Carly rea jepsen on 2016/3/28.
 */
public class JudgeException {

    public final static void judge(Exception e)
    {
        if(e instanceof MaxUploadSizeExceededException)
        {
            Assert.notNull(e,"上传文件过大");
        }else if(e instanceof IOException)
        {
            Assert.notNull(e,"上传文件有误");
        }else if (e instanceof ParseException)
        {
            Assert.notNull(e,"上传文件内容有误");
        }
    }

}
